// components/header/header.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    title: {
      type: String
    },
    color:{
      type:String
    },
    sty: {
      type: String
    },
    isTop:{
      type:Boolean
    }
  },
  options: {
    multipleSlots: true
  },
  attached() {
    
    var pages = getCurrentPages()[getCurrentPages().length-1].is
    let opt = wx.getMenuButtonBoundingClientRect()
    console.log(pages.split("/"));
    console.log(pages.split("/")[1] == "tabbar");
    
    let sty1 = `
      padding-top:${opt.top-5}px;
      height:${opt.bottom + 10}px;
    `
    let sty2 = `height:${opt.bottom}px; 
        `
      // console.log(JSON.stringify(opt));
      // console.log(sty1);

      this.setData({
        opt,
        sty1,
        sty2,
        isTab: pages.split("/")[1] == "tabbar"
     })
  },

  
  /**
   * 组件的初始数据
   */
  data: {
    
  },

  /**
   * 组件的方法列表
   */
  methods: {
    return(){
      wx.navigateBack({
        delta: 1
      });
    }
  }
})
